<%--
  Created by IntelliJ IDEA.
  User: 东科教育
  Date: 2021/7/14
  Time: 14:11
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/common.jsp"%>
<html>
<head>

    <title>Title</title>
    <style>
        .iframeClass{
            height: 800px !important;
        }
    </style>
    <script>
        $(function(){
            $('#tree').treeview({
                data: getTree(),
                showCheckbox: true
            });

            $('#tree').on('nodeSelected',function(event, data) {
                $.addtabs.add({
                    title : data.text,
                    url : data.url,
                    id : data.id
                })
            });
        })

        function getTree(){
            var tree = [
                {
                    text:"后台管理系统",
                    selectable : false,
                    state : {
                        selected : true
                    },
                    nodes: [
                        {
                            text:"用户管理",
                            selectable : false,
                            nodes : [
                                {
                                    text :"用户列表",
                                    icon:"glyphicon glyphicon-stop",
                                    id :1,
                                    url : "<%=path%>/user/toShow"
                                }
                            ]
                        },
                        {
                            text:"新闻管理",
                            selectable : false,
                            nodes : [
                                {
                                    text : "新闻列表",
                                    url : "<%=path%>/news/toShow",
                                    id : 2
                                },
                                {
                                    text : "新闻审核列表"
                                }
                            ]
                        }
                    ]
                }
            ];
            return tree;
        }
    </script>
</head>
<body>
<div class="container-fluid">
    <div class="row">
        <div class="col-md-3">
            <div id="tree"></div>
        </div>
        <div class="col-md-9">
            <div class="tabbable">
                <ul class="nav nav-tabs" id="myTab"></ul>
                <div class="tab-content"></div>
            </div>
        </div>
    </div>

</div>

</body>
</html>
